﻿<%@ Page Title="" Language="C#" MasterPageFile="~/layout/admin.Master" AutoEventWireup="true" CodeBehind="AdminArticle.aspx.cs" Inherits="SinhNhat.admin.AdminArticle" %>
<%@ Register assembly="CollectionPager" namespace="SiteUtils" tagprefix="cc1"  %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentMain" runat="server">

    <div>
        <asp:GridView ID="grArticle" runat="server" AutoGenerateColumns="false" DataKeyNames="ArticleID">
            <Columns>
                <asp:TemplateField HeaderText="No." ItemStyle-Width="40px">
                    <ItemTemplate>
                        <%# Container.DataItemIndex + 1 %>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <Columns>
                <asp:TemplateField HeaderText="Title" ItemStyle-Width="400px">
                    <ItemTemplate>
                        <%# Eval("Title") %>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <Columns>
                <asp:TemplateField HeaderText="Url" ItemStyle-Width="300px">
                    <ItemTemplate>
                        <a href='<%# Eval("Url")%>' target="_blank">
                            <%# Eval("Url")%>
                        </a>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <Columns>
                <asp:TemplateField HeaderText="Edit" ItemStyle-Width="60px">
                    <ItemTemplate>
                        <a href='<%# "/admin/EditArticle.aspx?articleID=" + Eval("ArticleID")%>'>
                            <img src="/data/images/pencil.png" />
                        </a>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <Columns>
                <asp:TemplateField HeaderText="Status" ItemStyle-Width="60px">
                    <ItemTemplate>
                        <asp:ImageButton ID="btnActice" runat="server" ImageUrl=<%# ((Boolean)Eval("IsLock"))?"/data/images/Lock.png":"/data/images/Unlock.png" %>
                            CommandArgument='<%# Eval("IsLock")%>' CommandName='<%# Eval("ArticleID")%>' />
                            
                            <%# ((Boolean)Eval("IsLock")) ? "Lock" : "Unlock"%>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>

            
            <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
            <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
            <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
            <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#0000A9" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#000065" />
        </asp:GridView>

        <cc1:CollectionPager ID="CollectionPager1" runat="server" PageSize="10"
            ResultsLocation="Bottom">
        </cc1:CollectionPager>


    </div>

</asp:Content>
